home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
The Director v1.2.adf
/
Scripts
/
blitutil
next >
Wrap
Text File
|
1988-05-08
|
4KB
|
169 lines
rem blitutil 1/8/88
rem
rem file creation additions suggested by Dr. Sidney Soclof
array 200,1
abort 0
print
print "a BLIT command utility"
print "This Director sequence is an example of a utility"
print "created with the Director to make it easier to figure"
print "the parameters for rectangle copy animations using the"
print "BLIT, DISSOLVE or WIPE commands."
print
print "BLITUTIL will ask you for the name of the 'background'"
print "file (the file to copy the rectangle(s) to), and the"
print "name of the 'objects' file (the source of the rectangle(s))"
print "After following the instructions and correctly positioning"
print "the rectangle, when BLITUTIL exits, it will display the"
print "parameters to a BLIT command to be used to copy the"
print "rectangle(s) as specified. In addition, these commands""
print "will be written to a file called RAM:BB that can be inserted"
print "directly into your scripts using your editor."
10 print
print "Background file name? (quit to exit)"
incli $0,30
print
compare a,"quit",$0
if a:end:endif
compare a,"QUIT",$0
if a:end:endif
a=0
open a,$0
if a=0:print "File not found":goto 10:endif
close
setblack 1
load 2,$0
new 1,2
display 1
resolution -1,xrs,yrs,bplanes
if ((xrs > 320) & (xrs < 640)) | (xrs > 640)
position -1,-1 :rem looks like overscan
endif
setblack 0
30 clear:pen 1,31:move 0,20:text "Objects file name? (quit to exit)"
move 10,40:input $0,30
compare a,"quit",$0
if a:end :endif
compare a,"QUIT",$0
if a:end :endif
a=0:open a,$0
if a=0:move 10,40:text "File not found":pause 20:goto 30:endif
close
load 3,$0
clear:move 10,20:text "Transparency on?"
move 10,40:input $0,30
trans=0
compare a,"Y*",$0
if a:trans=1:endif
compare a,"y*",$0
if a:trans=1:endif
pointer 1
TXT=1:N=1:v=1:open v,"RAM:BB"
90 clear
if TXT
move 10,20:text "Pick upper left coordinate"
move 10,40:text "then lower right coordinate,"
move 10,60:text "you can readjust the resultant"
move 10,80:text "rectangle by re-clicking near"
move 10,100:text "these corners once the rectangle"
move 10,110:text "appears...."
gosub 400
endif
display 3
resolution -1,xres,yres,bplanes
getmouse x,y
xv=(x-1)~0:yv=(y-1)~0
drawmode 2
pen 1,31
move xv,yv:if x>0:draw xv+10,yv:endif
move xv,yv:if y>0:draw xv,yv+10:endif
getmouse w,h
move xv,yv:if x>0:draw xv+10,yv:endif
move xv,yv:if y>0:draw xv,yv+10:endif
87 xv=x-1:yv=y-1
gosub 300:rem draw the box
88 pause 1:ifkey char:if char=13:goto 89:endif
ifmouse xt,yt:if xt=-1:goto 88:endif
gosub 300:rem draw the box
if !(xt-x)+!(yt-y) > !(xt-w)+!(yt-h):w=xt:h=yt
else:x=xt:y=yt:endif
goto 87
89 gosub 300:rem draw the box
drawmode -1
w = w-x
h = h-y
display 1
clear
if TXT
move 10,20:text "Now select target approximate"
move 10,40:text "upper left position, and use"
move 10,60:text "the keyboard arrow keys to"
move 10,80:text "adjust the positioning accurately."
move 10,110:text "Hit <return> when done."
gosub 400
endif
copy 2,1
getmouse X,Y
23 transparent trans
blit 3,x,y,X,Y,w,h
transparent 0
20 display 2
pause 1
display 1
pause 1
ifmouse xx,yy
if xx#-1:goto 24:endif
ifkey c
if c=13:goto 100:endif
if c#-101:goto 20:endif
getkey c
24 blit 2,X,Y,X,Y,w,h
if xx#-1:X=xx:Y=yy:endif
if c=67:X=X+1:endif
if c=68:X=X-1:endif
if c=66:Y=Y+1:endif
if c=65:Y=Y-1:endif
goto 23
100 print " BLIT buff,";x;",";y;",";X;",";Y;",";w;",";h
write " BLIT buff,";x;",";y;",";X;",";Y;",";w;",";h
display 2
blit 1,0,0,0,0,-1,-1
display 1
clear
move 25,100:text "BLIT NUMBER: ";N;" DONE"
a=20:b=20:gosub 200:move 30,50:text "MORE"
a=90:b=20:gosub 200:move 100,50:text "DONE"
110 getmouse a,b
if (b<20)|(b>70):goto 110:endif
if (a<20)|(a>140):goto 110:endif
if (a>70)&(a<90):goto 110:endif
if (a<90):N=N+1:TXT=0:goto 90:endif
CLOSE:end
200 rem do a box
move a,b
draw a+50,b
draw a+50,b+50
draw a,b+50
draw a,b
return
300 rem box routine with clipping
if xv>-1:move xv,0~yv:draw xv,yres_h:endif
if h<xres:move 0~xv,h:draw xres_w,h:endif
if w<xres:move w,yres_h:draw w,0~yv:endif
if yv>-1:move xres_w,yv:draw 0~xv,yv:endif
return
400 rem click on text ok box
pen 1,31
move 10,yrs-20:draw 50,yrs-20:draw 50,yrs-5:draw 10,yrs-5:draw 10,yrs-20
move 20,yrs-10:text "OK"
getmouse X,Y :rem any click will do, don't bother to check bounds
return
end